{{ define "user/userloginform.html"}}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            /*background: url('https://cdn.pixabay.com/photo/2018/08/14/13/23/ocean-3605547_1280.jpg') no-repeat;*/
            background: url('/static/upload/111111.png') no-repeat;
            /*background: url('https://i.hd-r.icu/78e23c5ba16e6f33b2d6fb0e7a68242b.jpg') no-repeat;*/
            /*background: url('https://i.hd-r.icu/17050a737065b01474bcb4299b56e8d6.jpg') no-repeat;*/
            /*background: url('https://i.hd-r.icu/64ae1ba55a110ef1463eb133f66dbbfb.jpg') no-repeat;*/
            background-size: 100% 130%;
        }

        #login_box {
            width: 20%;
            height: 400px;
            background-color: #00000060;
            margin: auto;
            margin-top: 10%;
            text-align: center;
            border-radius: 10px;
            padding: 50px 50px;
        }

        h2 {
            color: #ffffff90;
            margin-top: 5%;
        }

        #input-box {
            margin-top: 5%;
        }

        span {
            color: #fff;
        }

        input {
            border: 0;
            width: 60%;
            font-size: 15px;
            color: #fff;
            background: transparent;
            border-bottom: 2px solid #fff;
            padding: 5px 10px;
            outline: none;
            margin-top: 10px;
        }

        .sub {
            margin-top: 50px;
            width: 60%;
            height: 30px;
            border-radius: 10px;
            border: 0;
            color: #fff;
            text-align: center;
            line-height: 30px;
            font-size: 15px;
            background-image: linear-gradient(to right, #30cfd0, #330867);
        }

        #sign_up {
            margin-top: 45%;
            margin-left: 60%;
        }

        a {
            color: #b94648;
        }
    </style>
</head>

<body>
<div id="login_box">
    <h2>后台登录</h2>
        <div id="input_box">
            <input type="text" id="user" name="user" placeholder="请输入账号">
        </div>
        <div class="input_box">
            <input type="password" id="pwd"  name="pwd" placeholder="请输入密码">
        </div>
        <input class="sub" type="submit" id="sub" value="提交">
        <br>
</div>
</body>
</html>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        $("#sub").click(function (){
             var user=$("#user").val();
             var pwd=$("#pwd").val();
             if (user==''||pwd=='')
             {
                 alert("用户或密码不能为空")
                 return
             }
            $.ajax({
                type: "POST",
                url: "/login/userLoginData",
                data: {
                    user:user,
                    pwd:pwd
                },
                success: function(res) {
                    if (res.code === 200) {
                        alert(res.msg);
                        window.location.href = "/";
                    }
                }
            });

        })

    });
</script>

{{ end }}